package com.next

import grails.transaction.Transactional

@Transactional
class ProjectTeamService
{

    def initProjectTeam(Project project, User user)
    {
        def projectTeam = ProjectTeam.find("from ProjectTeam where project.id = :project and user.id = :user",
                                           [project: project.id, user: user.id])

        if (!projectTeam)
        {
            projectTeam = new ProjectTeam()
            projectTeam.project = project
            projectTeam.user = user
            projectTeam.save flush: true
        }
    }
}
